package com.jjyu.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jjyu.entity.Feedback;
import com.jjyu.entity.Friend;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;

@Mapper
public interface FeedbackMapper extends BaseMapper<Feedback> {
    public Feedback getFeedbackById(int feedbackId);

    @Insert("INSERT INTO feedback (user_id, restaurant_id, comment, rating, created_at, updated_at) " +
            "VALUES (#{userId}, #{restaurantId}, #{comment}, #{rating}, #{createdAt}, #{updatedAt})")
    @Options(useGeneratedKeys = true, keyProperty = "feedbackId", keyColumn = "feedbackId")
    public int addFeedback(Feedback feedback);
}
